<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>登录</title>
  <link rel="stylesheet" href="${ctx}/themes/default/assets/css/amazeui.css" />
  <link href="${ctx}/adminthemes/new/css/overhang.css" rel="stylesheet" type="text/css" />
  <link rel="stylesheet" href="${ctx}/themes/default/css/common.min.css" />

<!-- 访问量 -->
<#assign visitorWebsite = newTag("visitorWebsite")>
<#assign visitor = visitorWebsite()>


<!-- 获取登录信息 -->
<#assign spiteLogTag = newTag("spiteLogTag")>
<#assign flag = spiteLogTag("{'visitPage':'login.html','pageName':'登录页面','flag':'0'}")>

<#if flag==0>
	<script type="text/javascript">
		window.location.href="message.html?state=login";
		
	</script>
</#if>


</head>
<body class="login-container">
<style type="text/css">
.login-container {
	width:100%;
	height:100%;
	margin-top:150px;
	background:url("${ctx}/themes/default/img/login-bg.jpg");
	position:relative
}
.login-container .login-box {
	width:326px;
	margin:0 auto;
	margin-top:-60px;
}
.login-container .login-box .logo-img {
	width:159px;
	margin:0 auto
}
.login-container .login-box .am-form {
	margin-top:68px
}
.login-container .login-box .am-form .am-form-group {
	overflow:auto;
	border-bottom:2px #68c6de solid;
	margin-bottom:30px
}
.login-container .login-box .am-form .am-form-group label {
	float:left
}
.login-container .login-box .am-form .am-form-group label i {
	font-size:24px;
	color:#68c6de
}
.login-container .login-box .am-form .am-form-group input {
	width:265px;
	float:left;
	margin-left:10px;
	border:0;
	background:0 0
}
.login-container .login-box .am-form .am-btn-secondary {
	width:164px;
	height:50px;
	background:#68c6de;
	border-color:#68c6de;
	border-radius:27px;
	display:block;
	margin:50px auto 0
}
@media screen and (max-width:640px) {
	.login-container {
	padding:0 15px;
	margin-top:80px
}
.login-container .login-box {
	width:100%
}
.login-container .login-box .am-form {
	margin-top:50px
}
.login-container .login-box .am-form .am-form-group input {
	width:88%
}
}.register-container {
	width:100%;
	height:100%;
	background:url("${ctx}/themes/default/img/login-bg.jpg")
}
.register-container .register-box {
	width:442px;
	height:auto;
	margin:122px auto 0
}
.register-container .register-box .am-form legend {
	border-bottom:0
}
.register-container .register-box .am-form .register-info {
	font-size:14px;
	color:#9b9b9b;
	margin-top:22px
}
.register-container .register-box .am-form .am-form-group {
	overflow:auto
}
.register-container .register-box .am-form .am-form-group label {
	font-size:16px;
	color:#9b9b9b;
	line-height:40px
}
.register-container .register-box .am-form .am-btn-secondary {
	width:164px;
	height:50px;
	border-radius:27px;
	background-color:#68c6de;
	border-color:#68c6de;
	margin-left:81px;
	margin-top:30px
}
@media screen and (max-width:640px) {
	.register-container .register-box {
	padding:0 15px;
	width:100%!important;
	margin-top:50px
}
.register-container .register-box .am-u-md-2 {
	text-align:left!important
}
.register-container .register-box .am-u-md-10 {
	padding:0!important;
	text-align:left
}
.register-container .register-box .am-btn-secondary {
	margin:0 auto
}
}.error {
	text-align:center;
	color:#fff;
	padding-bottom:80px
}
.error.error-dark {
	background:url("${ctx}/themes/default/img/pattern-dark.png")
}
.error.error-light {
	background:url("${ctx}/themes/default/img/pattern-light.png");
	color:#adadad
}
.error.error-light .am-btn-secondary {
	border:2px solid #adadad;
	color:#adadad
}
.error h2 {
	font-size:190px
}
.error p:nth-of-type(1) {
	font-size:30px;
	margin-top:-20px;
	margin-bottom:0
}
.error p:nth-of-type(2) {
	font-size:20px;
	margin-top:0!important
}
.error .am-btn-secondary {
	background:0 0;
	border:2px solid #fff;
	font-size:18px;
	border-radius:4px;
	padding:10px 30px;
	margin-top:25px
}
@media screen and (max-width:640px) {
	.error-container.error-dark-box {
	height:100%;
	background:url("${ctx}/themes/default/img/pattern-dark.png")
}
.error-container.error-light-box {
	height:100%;
	background:url("${ctx}/themes/default/img/pattern-light.png")
}
.error-container .error {
	padding:0 20px
}
.error-container .error h2 {
	font-size:120px
}
.error-container .error p:nth-of-type(1) {
	font-size:25px
}
.error-container .error p:nth-of-type(2) {
	font-size:15px
}
}




</style>







  <div class="login-box">
    <div class="logo-img">
      <img src="${ctx}/themes/default/img/logo2_03.png" alt="" />
    </div>
    <form class="am-form loginForm" data-am-validator>
      <div class="am-form-group">
        <label for="doc-vld-name-2"><i class="am-icon-user"></i></label>
        <input type="text" id="doc-vld-name-2" class="student_number" minlength="3" name="student_number" placeholder="输入用户名" required/>
        </br></br>
        <span class="number_msg" style="color:red;display: none;"></span>
      </div>

      <div class="am-form-group">
        <label for="doc-vld-email-2"><i class="am-icon-key"></i></label>
        <input type="password" id="doc-vld-email-2" class="password" name="password" placeholder="输入密码" required/>
        </br></br>
        <span class="password_msg" style="color:red;display: none;"></span>
      </div>
      <button class="am-btn am-btn-secondary" type="button" onclick="login()" style="outline:none;">登录</button>
      
      <div class="text" style="border:0px solid #000000;width:340px;height:30px;">
      	<a href="${ctx}/member/register.html" style="color:#68c6de;float:left;">注册</a>
      	<a href="${ctx}/index.html" style="color:#68c6de;float:right;">首页</a>
      </div>
    </form>
  </div>
  
  <script src="${ctx}/themes/default/js/jquery-1.8.3.min.js" charset="utf-8"></script>
    <script type="text/javascript" src="${ctx}/adminthemes/new/js/jquery.ui.js"></script>
  <script type="text/javascript" src="${ctx}/adminthemes/new/js/overhang.js"></script>
    <script src="${ctx}/themes/default/js/jquery-form-2.33.js" charset="utf-8"></script>
    <script type="text/javascript" src="${ctx}/themes/default/assets/js/amazeui.min.js"></script>
  <script type="text/javascript" src="${ctx}/adminthemes/new/js/easy-ui/jquery.easyui.min.js"></script>
  <script type="text/javascript" src="${ctx}/adminthemes/new/js/easy-ui/easyui-lang-zh_CN.js"></script>

<script type="text/javascript">



function login(){
	var student_number=$(".student_number").val();
	var password=$(".password").val();

	//学号
	if(student_number==null || student_number==""){
		$(".number_msg").css("display","block");
		$(".number_msg").text("学号没有填写！");
		return null;
	}
	
	student_number=student_number.toUpperCase();
	var flag=student_number.indexOf("P1"); 
	if(flag==-1){
		$(".number_msg").css("display","block");
		$(".number_msg").text("学号填写错误！");
		return null;
	}
	var len=student_number.length;
	if(len!=10){
		$(".number_msg").css("display","block");
		$(".number_msg").text("学号填写错误！");
		return null;
	}
	$(".number_msg").css("display","none");
	//密码
	if(password==null || password==""){
		$(".password_msg").css("display","block");
		$(".password_msg").text("密码没有填写！");
		return null;
	}
	len=password.length;
	if(len<6 || len>12){
		$(".password_msg").css("display","block");
		$(".password_msg").text("密码填写错误！");
		return null;
	}
	$(".password_msg").css("display","none");
	
	
	var options = {
		url :"${ctx}/api/member/login.do",
		type : "POST",
		dataType : 'json',
		success : function(result) {				
		 	if(result.result==1){
		 		

		 	   location.href="${ctx}/index.html";
	
		 		
		 	}else if(result.result==0){
		 		$("body").overhang({
		 			type: "error",
		 			message: result.message
		 		});
		 	}
		},
		error : function(e) {
			$("body").overhang({
	 			type: "error",
	 			message: "请求错误！请重试！"
	 		});
			
		}
	};
	$(".loginForm").ajaxSubmit(options);
}


</script>
  
  
<#include 'member_footer.html'>
